<template>
  <div class="editable-cell" @click.stop="changeStatus(true)">
    <a-date-picker
      v-if="type === 'datepicker'"
      :defaultValue="value ? moment(value, 'YYYY-MM-DD') : ''"
      @change="onDateChange"
    ></a-date-picker>
    <template v-else>
      <div v-if="editable" class="editable-cell-input-wrapper">
        <a-input ref="cellInput" v-model="value" @blur="changeStatus(false)" />
      </div>
      <div v-else class="editable-cell-text-wrapper">
        {{ value || "  " }}
      </div>
    </template>
  </div>
</template>

<script lang='ts' src='./index.ts'></script>
<style lang='scss' scoped>
@import "./_index.scss";
</style>
